onSelect Event

Description

Fires when a value in the List is set.

Discussion

The onSelect event is triggered when the List's value is set. This includes when a user clicks on a row in the List.

OnSelect is a superset of onClick because it fires when a value is set by clicking on a row, or using a method of the List to set the List value, or through keyboard navigation.

In addition the Javascript can reference the 'this' scope, a pointer to the List object.

If the List does not allow NULL selections, then this event will fire when the List is being initially rendered and not all properties of the List are available. Therefore you might want to wrap your event handler code in a test using the 'this.initialized' property of the List. For example:

if(this.initialized) { /*your onSelect event here*/ }

See Also